-- background: 2678 from stack: in -- bmap block id: 4154 -- flags: 0000 -- background id: 0 -- name: game ----- HyperTalk script ----- on openBackground push recent card end openBackground -- part 59 (field) -- low flags: 01 -- high flags: 2000 -- rect: left=326 top=121 right=148 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 16384 -- line height: 18 -- part name: newletters -- part 19 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=325 top=175 right=213 bottom=506 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: WrongLetters -- part 54 (field) -- low flags: 01 -- high flags: 2000 -- rect: left=322 top=224 right=288 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: response -- part 58 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=468 top=85 right=107 bottom=498 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: GuessLetters ----- HyperTalk script ----- on closeField global theWordHM, wrongguessesHM, totalWrongGuessesHM global EightTries, SixTries put empty into field "response" if EightTries then put 8 into MaxErrors if SixTries then put 6 into MaxErrors --get rid of returns and spaces in entry box repeat for the number of chars in field "guessLetters" if last char of field "guessLetters" is return OR last char of field "guessLetters" is space then put empty into last char of field "guessLetters" end if end repeat --if user keeps guessing even after guesses are up --have to take care of this bec HC gets upset when --asked to hide fields that don't exist if wrongGuessesHM >= MaxErrors then rudetune put "Too many guesses! Choose another word." into field "response" exit closeField end if --take care of users who enter more than one letter if the length of field "guessLetters" >1 then rudetune put "Only one letter at a time, please." & return & "Try again." into field "response" put empty into field "guessLetters" get the loc of field "guessLetters" click at it exit closeField end if --take care of repeating a guess if field "guessLetters" is in field "wrongletters" or field "guessLetters" is in field "newletters" then rudetune put "You’ve already guessed “" & field "guessLetters" & ".”" & return & "Try again." into field "response" put empty into field "guessLetters" get the loc of field "guessLetters" click at it exit closeField end if --if user chooses right letter if theWordHM contains field "guessLetters" then repeat with x = 1 to the number of chars of theWordHM if char x of theWordHM = field "guessLetters" then put char x of theWordHM into char x of field "newletters" righttune end if end repeat else --if user chooses wrong letter put field "guessLetters" & space & space after field "wrongLetters" add 1 to wrongGuessesHM add 1 to totalWrongGuessesHM wrongtune --hide masking fields to show hanged man set the numberFormat to 0 put wrongGuessesHM into mistakeNumber put "error" & mistakenumber into whichMask --if user chose eight tries if EightTries then hide field whichMask -- if user chose six tries if SixTries then if mistakenumber < 3 then hide field whichMask if mistakenumber = 3 OR mistakenumber = 4 then put mistakenumber + 2 into temp put "error" & temp into whichOtherMask set the lockscreen to true hide field whichMask hide field whichOtherMask set the lockscreen to false end if if mistakenumber > 4 then add 2 to mistakenumber put "error" & mistakenumber into whichMask hide field whichMask end if end if --if six tries end if --if guessed right letter, else --if user has guessed all the right letters if field "newletters" = theWordHM then --if perfect attempt if wrongGuessesHM is empty then put "Perfect!" into field "response" else put any line of field "Congratulations" into field "response" end if happytune --do scoring set the numberFormat to 0.00 put totalWrongGuessesHM / field "WordNumber" into field "average" end if --if user has blown it if wrongGuessesHM = MaxErrors then dirge put any line of field "regrets" & return & "“" & theWordHM & ".”" into field "response" --do scoring set the numberFormat to 0.00 put totalWrongGuessesHM/ field "WordNumber" into field "average" end if put empty into field "guessLetters" get the loc of field "guessLetters" click at it end closeField -- part 71 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=110 top=19 right=107 bottom=191 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error1 -- part 72 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=183 top=35 right=108 bottom=306 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error4 -- part 73 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=61 top=85 right=186 bottom=259 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error2 -- part 74 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=0 top=35 right=108 bottom=118 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error3 -- part 75 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=213 top=87 right=184 bottom=306 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error6 -- part 76 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=6 top=84 right=185 bottom=95 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error5 -- part 77 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=146 top=184 right=334 bottom=304 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error7 -- part 78 (field) -- low flags: 01 -- high flags: 0001 -- rect: left=3 top=184 right=333 bottom=150 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: error8 -- part 80 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=481 top=0 right=21 bottom=507 -- title width / last selected line: 0 -- icon id / first selected line: 20689 / 20689 -- text alignment: 1 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Home ----- HyperTalk script ----- on mouseUp go home end mouseUp -- part 81 (button) -- low flags: 00 -- high flags: A002 -- rect: left=321 top=318 right=340 bottom=420 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 100 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Another word ----- HyperTalk script ----- on mouseUp global theWordHM, noMusic if not noMusic then play "Harpsichord" ee c doNewWord set the locktext of field "newletters" of card "game" to false put the number of chars in theWordHM into letterNumber repeat for letterNumber get the loc of field "newletters" of card "game" click at it type "-" end repeat set the locktext of field "newletters" of card "game" to true get the loc of field "guessLetters" click at it end mouseUp -- part 82 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=479 top=316 right=342 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 25002 / 25002 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: help ----- HyperTalk script ----- on mouseUp visual venetian blinds slowly go to card id 3955 end mouseUp -- part 83 (button) -- low flags: 00 -- high flags: A002 -- rect: left=422 top=318 right=340 bottom=476 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 100 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: Options ----- HyperTalk script ----- on mouseUp visual venetian blinds slowly go to card id 5038 end mouseUp -- part 84 (field) -- low flags: 80 -- high flags: 0007 -- rect: left=15 top=211 right=265 bottom=282 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: congratulations -- part 85 (field) -- low flags: 80 -- high flags: 0007 -- rect: left=15 top=273 right=327 bottom=282 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: regrets -- part 87 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=458 top=286 right=306 bottom=505 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 100 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: average -- part 88 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=376 top=286 right=306 bottom=405 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 100 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: wordNumber -- part 94 (field) -- low flags: 81 -- high flags: 2001 -- rect: left=7 top=41 right=314 bottom=301 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: YourOwnLabel -- part 92 (field) -- low flags: 80 -- high flags: 0007 -- rect: left=38 top=91 right=276 bottom=268 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: YourOwnWordlist -- part 91 (field) -- low flags: 80 -- high flags: 0007 -- rect: left=31 top=244 right=314 bottom=259 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: StandardWordlist